The present invention relates to a method of estimating the mid-points of bar code elements.
As is known, bar codes (FIG. 3) are optical codes comprising a number of dark (normally black) rectangular elements (bars) separated by light (normally white) elements (spaces) and containing coded information. Each bar code symbol comprises a number of definite sequences--or so-called pattern--of bars and spaces composing the alphabet of the code, and the simplest symbols employ elements (bars and spaces) of two thicknesses, so that, for two-thickness codes, each pattern is normally defined by a combination of four different elements : narrow and wide bars, narrow and wide spaces. The narrowest element is normally referred to as the "unit element" or "module", which, in all commonly used symbols, is the same width for both bars and spaces.
One type of bar code reading device comprises a lighting device for directing a scanning beam onto the bar code; and a sensor receiving part of the light diffused by the support on which the bar code is impressed, and which, in response to the radiation impinging on it, generates an electric signal whose waveform is modulated by the alternating light/dark elements of the bar code. As is known, light is absorbed by the bars and reflected by the spaces, so that the signal assumes a high value at the spaces (on account of the high degree of radiation impinging on the sensor) and a low value at the bars (on account of the poor degree of radiation impinging on the sensor). The signal generated by the sensor is therefore an analog signal with a typical alternating pattern of peaks and valleys, each peak corresponding to a space, and each valley to a bar.
Another type of bar code reading device comprises a light source (e.g. a series of LEDs) for evenly illuminating the whole code; and a viewing sensor, in particular a linear sensor, for receiving the radiation diffused by the code. The linear sensor comprises successive elementary portions, which receive the radiation diffused by successive adjacent portions of the code, so that an alternating signal of the above type, modulated by the successive light and dark elements of the code, can be reconstructed by successively picking up the signals produced by the elementary portions of the sensor. Other reading devices comprise telecameras for picking up a two-dimensional grey-level image of the code, and supplying the image to electronic processing devices for extracting the above alternating signal from the two-dimensional image.
The region between a peak and the two adjacent valleys of the alternating signal represents the width of a space, and the region between a valley and the two adjacent peaks the width of a bar. FIG. 4 shows an ideal profile obtained reading a bar code in ideal conditions, with absolutely no noise or blurring.
Currently used readers employ a threshold to digitize the analog signal, i.e. to convert a signal of numerous values into an alternating signal comprising a high state corresponding to high reflectivity (above the threshold), and a low state corresponding to low reflectivity (below the threshold); and the alternating signal is subsequently processed to determine, in particular, maximum and minimum points of the signal corresponding to mid-points of the spaces and bars respectively, i.e. to the mid-points of the component elements of the bar code.
The waveform of the electric signal obtained using known reading devices is affected by numerous factors, including:
A) Waveform blurring B. This is defined mathematically as the relationship between the standard deviation std of the function describing the spatial energy dispersion of the laser beam (spot) illuminating the optical code, and the dimension W of the narrowest code element, that is: EQU B=std/W
Blurring therefore increases alongside an increase in the energy dispersion of the laser beam about a mean value, i.e. alongside enlargement of the laser beam spot, and alongside a reduction in the size of the bar code, and seriously affects the waveform of the alternating signal by lowering the peaks (FIG. 6) representing the narrowest spaces, and raising the valleys representing the narrowest bars of the code. Over and above a given blur value, even sequences of narrow elements between two wide elements are absorbed by the wide elements into a single edge, and odd sequences of narrow elements between two wide elements merge into a single element, thus preventing the alternating signal from being decoded correctly.
B) The electrooptical acquisition system. As is known, electrooptical acquisition systems act as "low-pass" filters, which tend to eliminate the higher space frequencies of the scanned bar code signal. As long as the space frequencies of the code correspond with the passband operating region of the electrooptical device, deformation of the signal is negligible and the resulting measurements therefore accurate. Conversely, when the reading device operates outside the passband (because the code is printed smaller or is not within the focus of the electrooptical acquisition device), deformation of the analog signal is no longer negligible, and such as to affect the reading process and possibly result in subsequent decoding errors.
C) Analog signal sampling frequency. Before being processed, the analog signal from the sensor must be sampled, i.e. converted into a sequence of numbers, and the resolution of reading devices featuring a photodiode is related to the sampling frequency of the analog signal. When the signal is high-resolution sampled, well in excess of the code dimensions, and in the absence of any other sources of error, the profile obtained by discretizing the analog waveform is a faithful image of the original, but is inaccurate when the sampling frequency is such as to prevent correct measurement of the narrower elements. As increasing the resolving power of the system invariably involves greater cost--more sensitive sensors, faster A/D converters, and more powerful computers with larger memories--processes capable of working to a precision greater than the resolution of the sampled signal (subpixel precision) are obviously preferable.
D) Analog signal quantization. The analog signal has an infinite number of possible values, as compared with a finite number of the sampled signal. The error introduced into the measuring process is known as the quantization error.
E) Ink-spread distortion. Very often, poor printing of the bar codes results in a systematic increase or reduction in the width of the bars with respect to the spaces (positive or negative ink spread).
F) Flaws in the code. Printing errors may result in the code elements (bars and spaces) differing widely from the nominal values, i.e. in the nominal relationships not being respected, and, when close to or above the maximum tolerance for a given system of symbols, such errors may result in improper decoding of the bar code.
G) Noise. This is a general term used to indicate both "electronic" noise in the electrooptical section, and environmental noise, e.g. fluctuations in lighting, both of which may more or less noticeably affect the waveform profile, as shown by the ideal profile in FIG. 4, and the real profile in FIG. 5 comprising spurious noise-induced peaks.
H) Nonuniform reflectivity profile. This type of flaw produces profiles affected by variations in the mean reflectivity value (higher peaks at the end of the code or vice versa), possibly caused by nonuniform lighting or by the acquisition method.
Moreover, known methods of determining the code element (space and bar) arrangement provide for locating the wavefronts of the signal, which, for the reasons listed above, fails to provide for determining the code element arrangement accurately.